//标题 公共样式
var titleTextStyle={
    fontFamily:'microsoft yahei',
    fontSize:14,
    fontWeight:'normal'
};
//工具箱 公共
var echartToolbox={
	right:'35',
    show : true,
    feature : {
        saveAsImage : {show: true}
    }
}
var backgroundColor='#FFF';
//无数据时显示样式
var noDataShowStyle={
		text: '无数据',
		textColor: '#000',
		maskColor: 'rgba(255, 255, 255, 0.1)'
	};
var loadingDataShowStyle={
		text: '正在加载',
		textColor: '#000',
		maskColor: 'rgba(255, 255, 255, 0.1)'
	};
//---图例翻页用到的变量
var legendPagemodeContainer='<div class="js-eclegend-tool" style="position: absolute;left: 45%;bottom: 30px"></div>';
var legendPagemodeHtml = '<span class="js-prePage"><i class="fa fa-arrow-circle-o-left" aria-hidden="true" title="已经是第一页" style="font-size:25px;color:#BFBFBF;cursor:pointer"></i></span>'
						+'<span class="js-nextPage"><i class="fa fa-arrow-circle-o-right" aria-hidden="true" title="下一页" style="margin-left:10px;font-size:25px;color:#1296DB;cursor:pointer"></i></span>';


/**
 *
 * @Discription:折线图
 * @Autor ：mazhaoyan
 * @param container
 * @param lines
 * @param data
 * @param title
 * @param subtitle
 * @param chartParams
 * 2019年9月17日
 * @returns
 */
function lineChartVte(container, lines, data, title, subtitle,chartParams){
	var titleShow=chartParams.titleShow==false?false:true;//是否显示标题
	var rotateNum=chartParams.rotate==undefined?0:chartParams.rotate;//X轴标签名称倾斜角度
	var dataZoom=chartParams.isDataZoom==true?true:false;//是否启动缩放
	var legendShow=chartParams.legendShow==false?false:true;//是否显示图例
	var legendPosition=chartParams.legendPosition=='top'?'top':'bottom';//图例位置
	var legendPositionVal=chartParams.legendPositionVal==undefined?legendPosition:chartParams.legendPositionVal;//图例位置偏移像素值
	var showCode=chartParams.showCode==true?true:false;// 显示的是否是编码(如显示MDC，ADRG等)
	var formatterFunc=chartParams.formatterFunc==undefined?null:chartParams.formatterFunc;//提示框格式化函数
	var gridLeft=chartParams.gridLeft==undefined?10:chartParams.gridLeft;//坐标与左边的距离
	var gridRight=chartParams.gridRight==undefined?'10%':chartParams.gridRight;//坐标与右边的距离
	var gridTop=chartParams.gridTop==undefined?10:chartParams.gridTop;//坐标与顶部的距离
	var gridBottom=chartParams.gridBottom==undefined?'10':chartParams.gridBottom;//坐标与底部的距离
	var connectNulls=chartParams.connectNulls==true?true:false;//是否连接空点
	var xAxisShowMinLabel=chartParams.xAxisShowMinLabel==false?false:null;
	var xAxisShowMaxLabel=chartParams.xAxisShowMaxLabel==false?false:null;
	var yAxisShowMinLabel=chartParams.yAxisShowMinLabel==false?false:null;//是否显示最小 tick 的 label
	var yAxisShowMaxLabel=chartParams.yAxisShowMaxLabel==false?false:null;//是否显示最大 tick 的 label
	var yAxisName = chartParams.yAxisName==undefined?"":chartParams.yAxisName;
	var toolbooxShow = true;
	if(chartParams.echartToolbox!=undefined &&chartParams.echartToolbox.show !=undefined){
		toolbooxShow = chartParams.echartToolbox.show;
	}
	//设置echartToolbox
	echartToolbox.show = toolbooxShow;
	//图例
	var group = {data: []};
	group.show = legendShow;
	group[legendPosition]=legendPositionVal;
	for(var o in lines){
		if(showCode){
			group.data.push(lines[o].ccode);
		}
		else{
			group.data.push(lines[o].desc);
		}
		lines[o].data=[];//注意将之前的数据清空，否则有可能会有bug
	}
 	var xData = [];
 	if(data!=undefined && data.length>0){
 		for (var i = 0; i < data.length; i++) {
 			var obj = data[i];
 			for(var j=0; j<obj.length; j++){
 				if(i == 0){
 					if(obj[j].ddesc==null){
	 					    xData.push('');
 					}
 					else{
 						xData.push(obj[j].ddesc);
 					}
 				}
 				if(obj[j][lines[i].code] != null){
 					lines[i].data.push(obj[j][lines[i].code]);
 				}else{
 					lines[i].data.push('');
 				}
 			}
 		}
 	}
 	var series = [];
 	for(var o in lines){
 		var serie = { smooth: true, data: lines[o].data, type: 'line',"connectNulls":connectNulls};
 		if(showCode){
 			serie.name=lines[o].ccode;
		}
		else{
			serie.name=lines[o].desc;
		}
 		series.push(serie);
 	}
     var option = {
         title : {
        	 show:titleShow,
             text: title,
             textStyle:titleTextStyle
         },
         grid: {
 	        left: gridLeft,
 	        right:gridRight,
 	        top:gridTop,
 	        bottom:gridBottom,
 	        containLabel: true //注意加上，否则axisLabel有可能显示会不全
 	    },
         legend: group,
         tooltip : {
             trigger: 'axis',
             formatter:formatterFunc
         },
         xAxis : {
	            type : 'category',
	            boundaryGap : false,
	            data : xData,
	            splitLine:{
	            	show:true
	            },
	            axisLabel:{
	            	show:true,
	            	rotate:rotateNum,
	            	showMinLabel:xAxisShowMinLabel,
	            	showMaxLabel:xAxisShowMaxLabel
	            }
	        },
		    yAxis :{
	            type : 'value',
	            name : yAxisName,
	            axisLabel : {
	                formatter: '{value}'
	            },
	            splitLine:{
	            	show:true
	            },
	            axisLabel:{
	            	show:true,
	            	showMinLabel:yAxisShowMinLabel,
	            	showMaxLabel:yAxisShowMaxLabel
	            }
		    },
         toolbox: echartToolbox,
         series : series,
         backgroundColor:backgroundColor
     };
     //判断是否启用数据缩放
     if(dataZoom&&series[0].data.length>10){
 		var dataZoomRatio = 100-Math.ceil(1000/series[0].data.length);//展示10条左右数据
 		var dataZoomOption=[{type:'inside',xAxisIndex: [0],start: dataZoomRatio,end:100 }];
    	 	option.dataZoom=dataZoomOption;
 	};
     var myChart=initSeting(container,option,chartParams);

     //如果数据长度为0，则显示过渡效果
     if(data.length==0){
     	myChart.showLoading(noDataShowStyle);
     	myChart.setOption({
    		title:{show:false},toolbox:{show:false},yAxis:{show:false},xAxis:{show:false},legend:{show:false}
    	});
     }
}
/**
 * @Discription: 条形图
 * @param container 容器
 * @param lines 数据
 * @param data 数据
 * @param title 标题
 * @param subtitle 副标题
 * @param chartParams 参数
 * @returns
 */
function barChartVte(container, lines, data, title, subtitle,chartParams){
	var isxAxisShow = chartParams.isxAxisShow==undefined?true:chartParams.isxAxisShow; //X轴是否显示
	var isHorizontal=chartParams.isHorizontal==true?true:false;//柱状图纵向或横向，默认纵向
	var rotateNum=chartParams.rotate==undefined?0:chartParams.rotate;//X轴标签名称倾斜角度
	var isStack=chartParams.isStack==true?true:false;//是否堆叠
	var legendPosition=chartParams.legendPosition=='top'?'top':'bottom';
	var legendShow=chartParams.legendShow==true?true:false;//是否显示legend
	var showCode=chartParams.showCode==true?true:false;//坐标轴是否显示代码,坐标轴显示代码时传入1（如MDC）
	var xAxisShowMinLabel=chartParams.xAxisShowMinLabel==false?false:null;
	var xAxisShowMaxLabel=chartParams.xAxisShowMaxLabel==false?false:null;
	var yAxisShowMinLabel=chartParams.yAxisShowMinLabel==false?false:null;//是否显示最小 tick 的 label
	var yAxisShowMaxLabel=chartParams.yAxisShowMaxLabel==false?false:null;//是否显示最大 tick 的 label
	var xAxisInterval = chartParams.xAxisInterval==undefined?"auto":chartParams.xAxisInterval;//x轴是否显示所有的数值
	var barMaxWidth=(chartParams.barMaxWidth==undefined||chartParams.markLine==0)?false:chartParams.barMaxWidth;//柱条的最大宽度 如需设置传入具体数值
	var titleLeft = chartParams.titleLeft==undefined?"auto":titleLeft = chartParams.titleLeft;
	var yAxisName = chartParams.yAxisName==undefined?"":"单位:"+chartParams.yAxisName;//Y轴单位
	//markLine 标识线 具体格式 [[{x:280,yAxis:Number(avgFee_2)},{x:370,yAxis:Number(avgFee_4)}],[{x:90,yAxis:Number(avgFee_1)},{x:180,yAxis:Number(avgFee_3)}]]
	var markLine=(chartParams.markLine==""||chartParams.markLine==undefined)?false:chartParams.markLine;
	var barColor = ['#3292ce', '#e9714a', '#3bc93b', '#ddde46', '#d75fb7', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92','#F0EA4B','#058DC7','#ED561B', '#24CBE5',
	                '#3292ce', '#e9714a', '#3bc93b', '#ddde46', '#d75fb7', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92','#F0EA4B','#058DC7','#ED561B', '#24CBE5',
	                '#3292ce', '#e9714a', '#3bc93b', '#ddde46', '#d75fb7', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92','#F0EA4B','#058DC7','#ED561B', '#24CBE5',
	                '#3292ce', '#e9714a', '#3bc93b', '#ddde46', '#d75fb7', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92','#F0EA4B','#058DC7','#ED561B', '#24CBE5'];
	if(chartParams.barColor != null){
		barColor=chartParams.barColor;
	}
	var dataZoom=chartParams.isDataZoom==true?true:false;//是否启用datazoom
	
	

	//图例
	var group = {data: []};
	group[legendPosition]=legendPosition;
	group.show=legendShow;
	for(var o in lines){
		group.data.push(lines[o].desc);
		lines[o].data=[];//注意将之前的数据清空，否则有可能会有bug
	}
	var xData = [];
	if(data!=undefined && data.length>0){
		for (var i = 0; i <data.length; i++) {
			//封装坐标轴数据
			//判断ddesc或者ccode是否为空
			if(showCode){//坐标轴显示CODE
				if(data[i].ccode==null){
				    xData.push('');
				}
				else{
					xData.push(data[i].ccode);
				}
			}
			else{//坐标轴显示描述
				if(data[i].ddesc==null){
				    xData.push('');
				}
				else{
					xData.push(data[i].ddesc);
				}
			}
			for(var o in lines){
	            //为lines里的数组data压入数据
	            //判断压入的值是否为null，若为null则压入空字符
	           if(data[i][lines[o].code]==null){
	        	   lines[o].data.push({code: data[i].ccode, name: data[i].ddesc, value: ''});
	           }else{
	        	   lines[o].data.push({code: data[i].ccode, name: data[i].ddesc, value: data[i][lines[o].code]});
	           }
			}
		}
	}

	var grid = chartParams.grid == undefined ? {containLabel: true,left:"5px"} : chartParams.grid;
	//坐标轴
	var xAxisObj;
	var yAxisObj;
	var axisObjValue={type:'value',name : yAxisName,splitLine:{show:true},axisLine:{show:false},minInterval:1,min:0};
	var axisObjCate={type:'category',data: xData,splitLine:{show:false},axisLabel:{
    	show:true,
    	rotate:rotateNum,
    	interval:xAxisInterval,//xAxis.axisLabel.interval属性标签，坐标轴刻度标签的显示间隔，在类目轴中有效。默认会采用标签不重叠的策略间隔显示标签。可以设置成 0 强制显示所有标签
    	showMinLabel:xAxisShowMinLabel,
    	showMaxLabel:xAxisShowMaxLabel
    }};
	if (chartParams.formatter != undefined) {
		axisObjCate.axisLabel.formatter = chartParams.formatter;
	}
    if(!isxAxisShow){
		axisObjValue={type:'value',name : yAxisName,splitLine:{show:true},axisLine:{show:false},minInterval:1,min:0,show:false};
		axisObjCate={type:'category',data: xData,splitLine:{show:false},axisLabel:{
    	show:true,
    	rotate:rotateNum,
    	interval:xAxisInterval,//xAxis.axisLabel.interval属性标签，坐标轴刻度标签的显示间隔，在类目轴中有效。默认会采用标签不重叠的策略间隔显示标签。可以设置成 0 强制显示所有标签
    	showMinLabel:xAxisShowMinLabel,
    	showMaxLabel:xAxisShowMaxLabel,show:false}
    	};
	}
	
	if(isHorizontal){
		xAxisObj=axisObjValue;
		yAxisObj=axisObjCate;
	}
	else{
		xAxisObj=axisObjCate;
		yAxisObj=axisObjValue;
	}
	//数据序列----series
	var series = [];
	if(lines!=undefined && lines.length>0){
		for (var i = 0; i <lines.length; i++) {
			var serie = {
					name: lines[i].desc,
					data: lines[i].data,
					type: 'bar',
					label:chartParams.label==undefined?{}:chartParams.label,
					itemStyle:{
						normal:{
							color:function (params){
								return barColor[params.dataIndex];
							}
						}
					}

			}
			if(isStack){//判断是否堆叠
				serie.stack='sum';
			}
			if(barMaxWidth){
				serie.barMaxWidth=barMaxWidth;
			}
			if(markLine){
				serie.markLine ={
	                data : [markLine[i]]
	            }
			}
			series.push(serie);
		}
	}
    var option = {
    	color: barColor,
    	backgroundColor : chartParams.backgroundColor == undefined ? 'transparent' :chartParams.backgroundColor,
    	title : {
            text: title,
            subtext: subtitle,
            textStyle:titleTextStyle,
            left:titleLeft
        },
        legend: group,
        tooltip : {
	        trigger: 'axis',
	        formatter: function(value){
	           var tips = '';
	           var unit = chartParams.yAxisName==undefined?"":chartParams.yAxisName;
		       if(value!=undefined && value.length>0){
		    	   for(var i = 0; i <value.length; i++)
	        		{
		        		var val = value[i].value;
		        		if(val == 'undefined')
	        			{
		        			val = '';
	        			}
		        		if(i==0)
	        			{
		        			if(showCode){//坐标轴显示CODE
		        				tips = value[i].data.code+'('+value[i].data.name+')' + '</br>' +value[i].seriesName+':'+val+unit;
			        		}else{//坐标轴显示描述

		        				tips = value[i].data.name + '</br>' +value[i].seriesName+':'+val+unit;
		        			}
	        			}
		        		else
	        			{
		        			tips += '</br>' +value[i].seriesName+':'+val+unit;
	        			}
	        		}
		        }
	        	return tips;
	        }
	    },
	    grid: {
	        containLabel: true, //注意加上，否则axisLabel有可能显示会不全
	        top:"30px",
            left:"5px",
            right:"5px",
            bottom:"5px"
	    },
	    xAxis : xAxisObj,
        yAxis : yAxisObj,
        toolbox: echartToolbox,
        series : series
        //backgroundColor:backgroundColor
    };
	
	if (chartParams.grid !== undefined) {
		option.grid = chartParams.grid;
	}
	
	if (chartParams.saveAsImage) {
		option.toolbox.feature.saveAsImage = chartParams.saveAsImage;
	}
    
    if(dataZoom&&series[0].data.length>30){
		//var dataZoomRatio = Math.ceil(1000/series[0].data.length);//展示10条左右数据
		var dataZoomOption=[{type:'slider',xAxisIndex: [0],start: 0,end: 30}];
   	 	option.dataZoom=dataZoomOption;
	};
    var myChart=initSeting(container,option,chartParams);
    if(data.length==0){
    	myChart.showLoading(noDataShowStyle);
    	myChart.setOption({
    		title:{show:false},toolbox:{show:false},yAxis:{show:false},xAxis:{show:false},legend:{show:false}
    	});
    }
    return option;
}



/**
 *
 * @ Discription: 饼状图
 * @Autor ：mazhaoyan
 * @param container
 * @param data
 * @param title
 * @param subtitle
 * @param chartParams
 * void
 * vteEcharts.js
 * 2018年7月6日上午10:35:30
 */
function pieCharts(container, data, title, subtitle,chartParams){//container:放图的容器，lines：bar（存放信息） title：主标题 subtitle：副标题
	chartParams=chartParams==undefined?{}:chartParams;
	var pagemode=chartParams.pagemode==true?true:false;//饼图默认不启用
	var legendShow=chartParams.legendShow==false?false:true;
	var legendPosition=chartParams.legendPosition=='top'?'top':'bottom';//图例位置
	var legendPositionVal=chartParams.legendPositionVal==undefined?legendPosition:chartParams.legendPositionVal;//图例位置偏移像素值
	var legendItemGap=chartParams.legendItemGap==undefined?false:chartParams.legendItemGap;
	var showLabel = chartParams.showLabel==false?false:true;;
	var showLabelLine = chartParams.showLabelLine==false?false:true;;
	var radius=chartParams.radius==undefined?[0, '60%']:chartParams.radius;
	var center=chartParams.center==undefined?['50%','60%']:chartParams.center;
	var barColor = ['#3292ce', '#e9714a', '#3bc93b', '#ddde46', '#d75fb7', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92','#F0EA4B','#058DC7','#ED561B', '#24CBE5'];
	if(chartParams.barColor != null){
		barColor=chartParams.barColor;
	}
	var group = {data: []};
	group.show=legendShow;
	group[legendPosition]=legendPositionVal;
	if(legendItemGap){
		group.itemGap=legendItemGap;
	}
	for(var o in data){
		group.data.push(data[o].name);
	}
    var option = {
    		color:barColor,
    		backgroundColor : chartParams.backgroundColor == undefined ? 'transparent' :chartParams.backgroundColor,
    		title : {
		        text: title,
		        subtext: subtitle,
		        textStyle:titleTextStyle
		    },
		    toolbox: echartToolbox,
		    tooltip : {
		        trigger: 'item',
		        formatter: "{a} <br/>{b} : <br/>{c} ({d}%)"
		    },
		    legend: group,
		    series : [
		        {
		            name: "占比",
		            type:'pie',
		            radius : radius,
		            center: center,
		            data:data,
		            label:{
		            	normal: {
		                    show: showLabel,
		                    position : 'outside',
		                    formatter: '{b}:{c}\n({d}%)'
		                }
		            },
		            labelLine:{
		            	normal: {
		                    show: showLabelLine

		                }
		            }
		        }
		    ],
		    animationDelayUpdate: function (idx) {
		        return idx * 5;
		    }
	        //backgroundColor:backgroundColor
    };
    if(pagemode){
		option.legend.pagemode=pagemode;//是否启用分页模式,pagemode 全部小写
	}
	var myChart=initSeting(container,option,chartParams);
    if(data.length==0){
    	myChart.showLoading(noDataShowStyle);
    }
    //图例分页
    if(pagemode){
    	var pagemodeLegendNewlineFlag=false;
        var pagemodeLegendWidth=0;
        var tempObj=container.next('.legendNewLine');
        if(tempObj.length>0){
        	pagemodeLegendNewlineFlag=true;
        	pagemodeLegendWidth=tempObj.attr('value');
        }
        legendPagemodeCommon(myChart,container,pagemode,pagemodeLegendNewlineFlag,pagemodeLegendWidth);
    }
}
/**
 *
 * @ Discription:
 * @Autor ：WENYI
 * @param container 容器
 * @param lines 数据
 * @param data 数据
 * @param title 标题
 * @param subtitle 副标题
 * @param chartParams参数
* 2017年7月5日下午4:27:32
 */
function barChart(container, lines, data, title, subtitle,chartParams){
	var isHorizontal=chartParams.isHorizontal==true?true:false;//柱状图纵向或横向，默认纵向
	var isStack=chartParams.isStack==true?true:false;//是否堆叠
	var legendPosition=chartParams.legendPosition=='top'?'top':'bottom';
	var showCode=chartParams.showCode==true?true:false;//坐标轴是否显示代码,坐标轴显示代码时传入1（如MDC）
	var barMaxWidth=(chartParams.barMaxWidth==undefined||chartParams.markLine==0)?false:chartParams.barMaxWidth;//柱条的最大宽度 如需设置传入具体数值
	//markLine 标识线 具体格式 [[{x:280,yAxis:Number(avgFee_2)},{x:370,yAxis:Number(avgFee_4)}],[{x:90,yAxis:Number(avgFee_1)},{x:180,yAxis:Number(avgFee_3)}]]
	var markLine=(chartParams.markLine==""||chartParams.markLine==undefined)?false:chartParams.markLine;
	var barColor = ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83',  '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'];
	if(chartParams.barColor != null){
		barColor=chartParams.barColor;
	}

	//图例
	var group = {data: []};
	group[legendPosition]=legendPosition;
	for(var o in lines){
		group.data.push(lines[o].desc);
		lines[o].data=[];//注意将之前的数据清空，否则有可能会有bug
	}
	var xData = [];
	if(data!=undefined && data.length>0){
		for (var i = 0; i <data.length; i++) {
			//封装坐标轴数据
			//判断ddesc或者ccode是否为空
			if(showCode){//坐标轴显示CODE
				if(data[i].ccode==null){
				    xData.push('');
				}
				else{
					xData.push(data[i].ccode);
				}
			}
			else{//坐标轴显示描述
				if(data[i].ddesc==null){
				    xData.push('');
				}
				else{
					xData.push(data[i].ddesc);
				}
			}

			for(var o in lines){
	            //为lines里的数组data压入数据
	            //判断压入的值是否为null，若为null则压入空字符
	           if(data[i][lines[o].code]==null){
	        	   lines[o].data.push({code: data[i].ccode, name: data[i].ddesc, value: ''});
	           }else{
	        	   lines[o].data.push({code: data[i].ccode, name: data[i].ddesc, value: data[i][lines[o].code]});
	           }
			}
		}
	}
	//坐标轴
	var xAxisObj;
	var yAxisObj;
	var axisObjValue={type:'value',splitLine:{show:true}};
	var axisObjCate={type:'category',data: xData,splitLine:{show:true}};
	if(isHorizontal){
		xAxisObj=axisObjValue;
		yAxisObj=axisObjCate;
	}
	else{
		xAxisObj=axisObjCate;
		yAxisObj=axisObjValue;
	}
	//数据序列----series
	var series = [];
	if(lines!=undefined && lines.length>0){
		for (var i = 0; i <lines.length; i++) {
			var serie = { name: lines[i].desc, data: lines[i].data, type: 'bar'}
			if(isStack){//判断是否堆叠
				serie.stack='sum';
			}
			if(barMaxWidth){
				serie.barMaxWidth=barMaxWidth;
			}
			if(markLine){
				serie.markLine ={
	                data : [markLine[i]]
	            }
			}
			series.push(serie);
		}
	}

    var option = {
    	color: barColor,
    	title : {
            text: title,
            subtext: subtitle,
            textStyle:titleTextStyle
        },
        legend: group,
        tooltip : {
	        trigger: 'axis',
	        formatter: function(value){
	           var tips = '';
		       if(value!=undefined && value.length>0){
		    	   for(var i = 0; i <value.length; i++)
	        		{
		        		var val = value[i].value;
		        		if(val == 'undefined')
	        			{
		        			val = '';
	        			}
		        		if(i==0)
	        			{
		        			if(showCode){//坐标轴显示CODE
		        				tips = value[i].data.code+'('+value[i].data.name+')' + '</br>' +value[i].seriesName+':'+val;
			        		}
		        			else{//坐标轴显示描述
		        				tips = value[i].data.name + '</br>' +value[i].seriesName+':'+val;
		        			}
	        			}
		        		else
	        			{
		        			tips += '</br>' +value[i].seriesName+':'+val;
	        			}
	        		}
		        }
	        	return tips;
	        }
	    },
	    grid: {
	        left: 5,
	        containLabel: true //注意加上，否则axisLabel有可能显示会不全
	    },
	    xAxis : xAxisObj,
        yAxis : yAxisObj,
        toolbox: echartToolbox,
        series : series,
        backgroundColor:backgroundColor
    };
    var myChart=initSeting(container,option,chartParams);
    if(data.length==0){
    	myChart.showLoading(noDataShowStyle);
    	myChart.setOption({
    		title:{show:false},toolbox:{show:false},yAxis:{show:false},xAxis:{show:false},legend:{show:false}
    	});
    }
}
/**
 *
 * @ Discription:折线图
 * @Autor ：WENYI
 * @param container
 * @param lines
 * @param data
 * @param title
 * @param subtitle
 * @param chartParams 参数
 *
 * 2017年7月7日上午00:42:40
 */
function lineChartBasic(container, lines, data, title, subtitle,chartParams){
	var titleShow=chartParams.titleShow==false?false:true;//是否显示标题
	var dataZoom=chartParams.isDataZoom==true?true:false;//是否启动缩放
	var legendPosition=chartParams.legendPosition=='top'?'top':'bottom';//图例位置
	var legendPositionVal=chartParams.legendPositionVal==undefined?legendPosition:chartParams.legendPositionVal;//图例位置偏移像素值
	var showCode=chartParams.showCode==true?true:false;// 显示的是否是编码(如显示MDC，ADRG等)
	var formatterFunc=chartParams.formatterFunc==undefined?null:chartParams.formatterFunc;//提示框格式化函数
	var gridLeft=chartParams.gridLeft==undefined?10:chartParams.gridLeft;//坐标与左边的距离
	var gridRight=chartParams.gridRight==undefined?'10%':chartParams.gridRight;//坐标与右边的距离
	var connectNulls=chartParams.connectNulls==true?true:false;//是否连接空点
	var xAxisShowMinLabel=chartParams.xAxisShowMinLabel==false?false:null;
	var xAxisShowMaxLabel=chartParams.xAxisShowMaxLabel==false?false:null;
	var yAxisShowMinLabel=chartParams.yAxisShowMinLabel==false?false:null;//是否显示最小 tick 的 label
	var yAxisShowMaxLabel=chartParams.yAxisShowMaxLabel==false?false:null;//是否显示最大 tick 的 label

	if(chartParams.unit!=undefined){
		unit=chartParams.unit;
	}
	//图例
	var group = {data: []};
	group[legendPosition]=legendPositionVal;
	for(var o in lines){
		if(showCode){
			group.data.push(lines[o].ccode);
		}
		else{
			group.data.push(lines[o].desc);
		}
		lines[o].data=[];//注意将之前的数据清空，否则有可能会有bug
	}
 	var xData = [];
 	if(data!=undefined && data.length>0){
 		for (var i = 0; i < data.length; i++) {
 			var obj = data[i];
 			for(var j=0; j<obj.length; j++){
 				if(i == 0){
 					if(obj[j].ddesc==null){
	 					    xData.push('');
 					}
 					else{
 						xData.push(obj[j].ddesc);
 					}
 				}
 				if(obj[j][lines[i].code] != null){
 					lines[i].data.push(obj[j][lines[i].code]);
 				}else{
 					lines[i].data.push('');
 				}
 			}
 		}
 	}
 	var series = [];
 	for(var o in lines){
 		var serie = { smooth: true, data: lines[o].data, type: 'line',"connectNulls":connectNulls};
 		if(showCode){
 			serie.name=lines[o].ccode;
		}
		else{
			serie.name=lines[o].desc;
		}
 		series.push(serie);
 	}
     var option = {
         title : {
        	 show:titleShow,
             text: title,
             textStyle:titleTextStyle
         },
         grid: {
 	        left: gridLeft,
 	        right:gridRight,
 	        containLabel: true //注意加上，否则axisLabel有可能显示会不全
 	    },
         legend: group,
         tooltip : {
             trigger: 'axis',
             formatter:formatterFunc
         },
         xAxis : {
	            type : 'category',
	            boundaryGap : false,
	            data : xData,
	            splitLine:{
	            	show:true
	            },
	            axisLabel:{
	            	show:true,
	            	showMinLabel:xAxisShowMinLabel,
	            	showMaxLabel:xAxisShowMaxLabel
	            }
	        },
		    yAxis :{
	            type : 'value',
	            axisLabel : {
	                formatter: '{value}'
	            },
	            splitLine:{
	            	show:true
	            },
	            axisLabel:{
	            	show:true,
	            	showMinLabel:yAxisShowMinLabel,
	            	showMaxLabel:yAxisShowMaxLabel
	            }
		    },
         toolbox: echartToolbox,
         series : series,
         backgroundColor:backgroundColor
     };
     //判断是否启用数据缩放
     if(dataZoom&&series[0].data.length>10){
 		var dataZoomRatio = 100-Math.ceil(1000/series[0].data.length);//展示10条左右数据
 		var dataZoomOption=[{type:'inside',xAxisIndex: [0],start: dataZoomRatio,end:100 }];
    	 	option.dataZoom=dataZoomOption;
 	};
     var myChart=initSeting(container,option,chartParams);
     //如果数据长度为0，则显示过渡效果
     if(data.length==0){
     	myChart.showLoading(noDataShowStyle);
     	myChart.setOption({
    		title:{show:false},toolbox:{show:false},yAxis:{show:false},xAxis:{show:false},legend:{show:false}
    	});
     }
}
/**
 *
 * @ Discription:
 * @Autor ：WENYI
 * @param container
 * @param legend 图例数据
 * @param series 数据序列
 * @param xAxis x坐标轴
 * @param yAxis y坐标轴
 * @param title 标题
 * @param subtitle 副标题
 * @param chartParams 参数
 * 2017年7月7日上午10:53:36
 */
function barLineMixChartBasic(container, legend,series,xAxis,yAxis,title, subtitle,chartParams)
{
	chartParams=chartParams==undefined?{}:chartParams;
	var pagemode=chartParams.pagemode==true?true:false;//默认不启用图例分页
	var dataZoom=chartParams.isDataZoom==true?true:false;//是否启用datazoom
	var legendPosition=chartParams.legendPosition=='top'?'top':'bottom';//legendPosition 图例位置
	var legendOption={"data":legend};
	legendOption[legendPosition]=legendPosition;
	var gridLeft=chartParams.gridLeft==undefined?60:chartParams.gridLeft;//坐标与左边的距离
	var gridRight=chartParams.gridRight==undefined?'10%':chartParams.gridRight;//坐标与右边的距离
	var gridTop=chartParams.gridTop==undefined?'60':chartParams.gridTop;//坐标与顶部的距离
	var gridBottom=chartParams.gridBottom==undefined?'60':chartParams.gridBottom;//坐标与底部的距离
	var formatterFunc=chartParams.formatterFunc==undefined?null:chartParams.formatterFunc;//提示框处理方法
	var option = {
			title : {
	             text: title,
	             subtext: subtitle,
	             textStyle:titleTextStyle
	        },
	        grid: {
	 	        left: gridLeft,
	 	        right:gridRight,
	 	        top:gridTop,
	 	        bottom:gridBottom
	 	    },
		    tooltip : {
		    	trigger :'axis',
		    	 showDelay : 0,
		    	 formatter : chartParams.formatterFunc
		    },
		    toolbox:echartToolbox,
		    calculable : true,
		    legend: legendOption,
		    xAxis : xAxis,
		    yAxis : yAxis,
		    series : series,
	        backgroundColor:backgroundColor
		};
	if(dataZoom&&series[0].data.length>10){
		var dataZoomRatio = Math.ceil(1000/series[0].data.length);//展示10条左右数据
		var dataZoomOption=[{type:'inside',xAxisIndex: [0],start: 0,end: dataZoomRatio}];
   	 	option.dataZoom=dataZoomOption;
	};
	if(pagemode){
		option.legend.pagemode=pagemode;//是否启用分页模式
	}
	var myChart=initSeting(container,option,chartParams);
    if(series[0].data.length==0){
    	myChart.showLoading(noDataShowStyle);
    	myChart.setOption({
    		title:{show:false},toolbox:{show:false},yAxis:[{show:false},{show:false}],xAxis:{show:false},legend:{show:false}
    	});
    }
  //图例分页--继续处理，添加相关点击事件
    if(pagemode){
    	var pagemodeLegendNewlineFlag=false;
        var pagemodeLegendWidth=0;
        var tempObj=container.next('.legendNewLine');
        if(tempObj.length>0){
        	pagemodeLegendNewlineFlag=true;
        	pagemodeLegendWidth=tempObj.attr('value');
        }
        legendPagemodeCommon(myChart,container,pagemode,pagemodeLegendNewlineFlag,pagemodeLegendWidth);
    }
}
/**
 *
 * @ Discription:  雷达图
 * @Autor ：WENYI
 * @param container
 * @param lines
 * @param data 数据
 * @param quotas 指标
 * @param title 标题
 * @param subtitle 副标题
 * @param chartParams 参数
 * 2017年7月6日下午9:04:06
 */
function radarCharts(container, lines, data, quotas, title, subtitle,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var pagemode=chartParams.pagemode==false?false:true;//雷达图默认启用图例分页
	var group =[];
	for(var o in lines){
		group.push(lines[o].desc);
	}
	if(data!=undefined && data.length>0){
		for (var i = 0, o=0; i<data.length, o<lines.length; i++, o++) {
			for(var o1 in quotas){
	            //为lines里的数组data压入数据
	            //判断压入的值是否为null，若为null则压入空字符
	           if(data[i][quotas[o1].code]==null){
	           lines[o].data.push(0);
	           }else{
				lines[o].data.push(Number(data[i][quotas[o1].code]));
	           }
			}
	}
	}
	var series = [];
	for(var o in lines){
		var serie = { name: lines[o].desc,value: lines[o].data};
		series.push(serie);
	}
	var option = {
    	backgroundColor : chartParams.backgroundColor == undefined ? 'transparent' :chartParams.backgroundColor,
	    title : {
	        text: title,
	        subtext: subtitle,
	        textStyle:{
                fontFamily:'microsoft yahei',
                fontSize:14,
                fontWeight:'normal'
            }
	    },
	    tooltip : {
			position:[3,3]//固定tooltip的位置
	    },
	    legend: {
	    	show : chartParams.legend.show == undefined ? true : chartParams.legend.show,
	    	top: 'bottom',
	        data:group
	    },
	    toolbox: echartToolbox,
	    radar: {
	        indicator:quotas,
	        center:['45%','50%'],
	        radius:'60%',
	        name:{
	        	textStyle :{
	        		color:'#000'
	        	}
	        }
	    },
	    series : [
	        {
	            type: 'radar',
	            data : series
	        }
	    ]
        //backgroundColor:backgroundColor
	};
	if(pagemode){
		option.legend.pagemode=pagemode;//是否启用分页模式
	}
	var myChart=initSeting(container,option,chartParams);
	//如果没有数据，则显示过渡效果
    if(data.length==0){
    	myChart.showLoading(noDataShowStyle);
    	myChart.setOption({
    		title:{show:false},toolbox:{show:false},radar:{axisLine:{show:false},splitLine:{show:false},splitArea:{show:false},name:{show:false}},legend:{show:false}
    	});
    }
    //图例分页--继续处理，添加相关点击事件
    if(pagemode){
    	var pagemodeLegendNewlineFlag=false;
        var pagemodeLegendWidth=0;
        var tempObj=container.next('.legendNewLine');
        if(tempObj.length>0){
        	pagemodeLegendNewlineFlag=true;
        	pagemodeLegendWidth=tempObj.attr('value');
        }
        legendPagemodeCommon(myChart,container,pagemode,pagemodeLegendNewlineFlag,pagemodeLegendWidth);
    }
}
/**
 *
 * @ Discription:
 * @Autor ：WENYI
 * @param container 容器
 * @param gaugeData 仪表盘数据
 * @param title 标题
 * @param name 数据名称
 * @param subtitle 副标题
 * @param chartParams
 * 2017年7月6日下午9:03:48
 */
 function gaugeCharts(container, gaugeData, title, name, subtitle,chartParams){
	var option = {
	    title : {
	        text: title,
	        subtext: subtitle,
	        textStyle:{
                fontFamily:'microsoft yahei',
                fontSize:14,
                fontWeight:'normal'
            }
	    },
	    tooltip : {
	        formatter: "{a} : {c}%"
	    },
	    toolbox: {
	        show : true,
	        feature : {
	            restore : {show: true},
	            saveAsImage : {show: true}
	        }
	    },
	    series : [
	              {
	            	  name:name,
	                  type:'gauge',
	                  center: ['50%', '60%'],
	                  detail : {formatter:'{value}%'},
	                  data:[gaugeData]
	              }
	          ],
	          backgroundColor:backgroundColor
	};
	initSeting(container,option,chartParams);
}
 /**
  * 线图----注意与折线图的区别
  * @ Discription:
  * @Autor ：WENYI
  * @param container
  * @param seriesData 线图数据
  * @param xAxis X轴数据
  * @param yAxis Y轴数据
  * @param legendData 图例数据
  * @param title
  * @param subtitle
  * @param chartParams
  * @returns
  * 2017年7月26日下午4:56:58
  */
function linesChartBasic(container,seriesData,xAxis,yAxis,legendData,title, subtitle,chartParams){
	 chartParams=chartParams==undefined?{}:chartParams;
	 var legendShow=chartParams.legendShow==true?true:false;//默认不显示图例
	 var formatterFunc=chartParams.formatterFunc==undefined?null:chartParams.formatterFunc;//提示框处理方法
	 var legend = {data: legendData, show: legendShow};
	 var option = {
		        title : {
		            text: title,
		            textStyle:titleTextStyle
		        },
		        legend: legend,
		        tooltip : {
		            showDelay : 0,
		            formatter : formatterFunc,
		            axisPointer:{
		                show: true,
		                type : 'cross',
		                lineStyle: {
		                    type : 'dashed',
		                    width : 1
		                }
		            }
		        },
		        xAxis : [
		            {
		            	name: xAxis.desc,
		                type : 'value',
		                nameLocation:'start'
		            }
		        ],
		        yAxis : [
		            {
		            	name: yAxis.desc,
		                show:true,
		                type : 'value',
		                axisLine:{
		                	lineStyle :{
		                		color :'#000'
		                	}
		                }
		            }
		        ],
		        toolbox: echartToolbox,
		        series : [{
		            type: 'lines',//线图，与折线图不一样
		            coordinateSystem: 'cartesian2d',
		            showSymbol:true,
		            symbol: ['circle','arrow'],
		            symbolSize:[5,10],
		            effect: {
		                show: true,
		                period:2,
		                symbol: 'arrow',//ECharts 提供的标记类型包括 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
		                symbolSize: 6,
		                trailLength: 0,
		                shadowColor: 'rgba(0, 0, 0, 0.5)',
		                shadowBlur: 5
		            },
		            lineStyle: {
		                normal: {
		                    width: 2,
		                    opacity: 0.6,
		                    curveness :0.2,//线的曲度
		                    shadowColor: 'rgba(0, 0, 0, 0.5)',
		                    shadowBlur: 5
		                }
		            },
		            data: seriesData
		        }],
		        backgroundColor:backgroundColor
		    };
	 if(xAxis && xAxis.xmin!=undefined){
			option.xAxis[0].min = xAxis.xmin;
	}
	if(xAxis && xAxis.xmax!=undefined){
		option.xAxis[0].max = xAxis.xmax;
	}
	if(yAxis && yAxis.ymin!=undefined){
		option.yAxis[0].min = yAxis.ymin;
	}
	if(yAxis && yAxis.ymax!=undefined){
		option.yAxis[0].max = yAxis.ymax;
	}
	if(chartParams.isDataZoom){	//是否启用数据缩放
		option.dataZoom=[{type:'inside',filterMode:'filter',xAxisIndex: [0],start: 0,end: 100},{type:'inside',filterMode:'filter',yAxisIndex: [0],start: 0,end: 100}];
	}
	if(chartParams.visualMap){//启用visualMap
		option.visualMap={
	        	type: 'continuous',
	            min: 0,
	            max: 100,
	            hoverLink:false,
	            realtime: false,
	            calculable : true,
	            textStyle:{color:'#000'},
	            range: [80,100],
	            left: 'right',
	        	top: 40,
	        	text: ["最差", "最好"],
	        	inRange: {
	        		color: ['lime', 'yellow', '#ff3333']
	            }

	        }
	}
	var myChart=initSeting(container,option,chartParams);
	myChart.on('click', chartParams.callback_click);
	myChart.on('datarangeselected', chartParams.callback_range);
	return myChart;
 }
/**
 * 散点图---科室指标象限分析、重点病种分析页面
 * 后台数据格式List<Map<String, Object>> or List<Entity>
 * @param container
 * @param group
 * @param series
 */
function scatterChartsWithLine(container,data,xyAx,title,lineData,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var legend = {data: [], show: false};
	var series = [];
	if(data!=undefined && data.length>0){
		for (var i = 0; i < data.length; i++) {
			legend.data.push(data[i].desc);
			var data1 = [];
            for(var j = 0;j<data[i].data.length;j++)
			{
				var d1 = [];
				if((data[i].data[j].xdata || data[i].data[j].x||data[i].data[j].xdata==0||data[i].data[j].x==0) && (data[i].data[j].ydata || data[i].data[j].y||data[i].data[j].ydata==0 || data[i].data[j].y==0)){
					d1.push(data[i].data[j].xdata!=null && data[i].data[j].xdata!=undefined ? data[i].data[j].xdata:data[i].data[j].x);
				    d1.push(data[i].data[j].ydata!=null && data[i].data[j].ydata!=undefined ? data[i].data[j].ydata:data[i].data[j].y);
				    if(chartParams.symbolValueMin&&chartParams.symbolValueMax){
				    	d1.push(data[i].data[j].symbolValue);
				    }
				    var dot = {"code":data[i].data[j].ccode,"color":data[i].data[j].color,"value":d1,"name":data[i].data[j].desc?data[i].data[j].desc:data[i].data[j].ddesc}
				    data1.push(dot);
				}
			}
		    var serie1 = {};
		    serie1 = { name: data[i].desc, data: data1, type: 'scatter',symbolSize:10,itemStyle:{normal:{color: function(params) {return params.data.color}}} }
		    if(chartParams.symbolValueMin&&chartParams.symbolValueMax){
		    	serie1.symbolSize=chartParams.symboSizeFunc;
		    }
		    if(chartParams.cursor)
	    	{
		    	serie1.cursor = chartParams.cursor;
	    	}
		    series.push(serie1);
		}
	}
	if(lineData!=null)
	{series[0].markLine = lineData};
	var option = {
        title : {
            text: title,
            textStyle:titleTextStyle
        },
        legend: legend,
        tooltip : {
            showDelay : 0,
            formatter : chartParams.formatterFunc,
            axisPointer:{
                show: true,
                type : 'cross',
                lineStyle: {
                    type : 'dashed',
                    width : 1
                }
            }
        },
        xAxis : [
            {
            	name: xyAx.xAxis.desc,
                type : 'value'
            }
        ],
        yAxis : [
            {
            	name: xyAx.yAxis.desc,
                show:true,
                type : 'value',
                axisLine:{
                	lineStyle :{
                		color :'#000'
                	}
                }
            }
        ],
        toolbox: echartToolbox,
        series : series,
        backgroundColor:backgroundColor
    };
	if(chartParams.xmin){
		option.xAxis[0].min = chartParams.xmin;
	}
	if(chartParams.xmax){
		option.xAxis[0].max = chartParams.xmax;
	}
	if(chartParams.ymin){
		option.yAxis[0].min = chartParams.ymin;
	}
	if(chartParams.ymax){
		option.yAxis[0].max = chartParams.ymax;
	}
	if(chartParams.isDataZoom){
		var dataZoomOption=[{type:'inside',xAxisIndex: [0],start: 0,end:100 },
		                    {type:'inside',yAxisIndex: [0],start: 0,end:100 }
							];
	 	option.dataZoom=dataZoomOption;
	}
	var myChart=initSeting(container,option,chartParams);
	myChart.on('click', chartParams.callBack_click);
}
/**
 * 指标象限图--病组指标象限分析使用
 * @param container
 * @param xyAx
 * @param data
 * @param subtitle
 */
function quotaScatter(container, xyAx, data, title, subtitle,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var series = [];
	var d1 = [];
	var d2 = [];
	var d3 = [];
	var d4 = [];
	if(data!=undefined && data.length>0){
		for (var i = 0; i < data.length; i++) {
			var value1 = data[i][xyAx.xAxis.code];
			var value2 = data[i][xyAx.yAxis.code];
			if(value1!=null && value1!=undefined && value2!=null && value2!=undefined ){
				var d=[];
				var v1 = parseFloat(value1)
				var v2 = parseFloat(value2);
				d.push(v1);d.push(v2);d.push(data[i].ddesc);
				if(v1>0 && v2>0){
					d1.push(d);
				}else if(v1<0 && v2>0){
					d2.push(d);
				}else if(v1<=0 && v2<=0){
					d3.push(d);
				}else if(v1>0 && v2<0){
					d4.push(d);
				}
			}
		}
	}
	var serie1 = {  };
    serie1 = { name: '1', data:d1 , type: 'scatter', itemStyle:{ normal:{color:'#f05a72'} },symbol:'circle',symbolSize: function (value){
        return 10;
    } }
    var serie2 = {};
    serie2 = { name: '2', data:d2, type: 'scatter', itemStyle:{ normal:{color:'#5bc0de'} },symbol:'circle',symbolSize: function (value){
        return 10;
    } }
    var serie3 = {};
    serie3 = { name: '3', data: d3,type: 'scatter', itemStyle:{ normal:{color:'#66cc66'} },symbol:'circle',symbolSize: function (value){
        return 10;
    } }
    var serie4 = {};
    serie4 = { name: '4', data: d4,type: 'scatter', itemStyle:{ normal:{color:'#fed503'} },symbol:'circle',symbolSize: function (value){
        return 10;
    } }
    if(chartParams.cursor)
	{
    	serie1.cursor = chartParams.cursor;
    	serie2.cursor = chartParams.cursor;
    	serie3.cursor = chartParams.cursor;
    	serie4.cursor = chartParams.cursor;
	}
    series.push(serie1);
    series.push(serie2);
    series.push(serie3);
    series.push(serie4);
	var option = {
        title : {
            text: title,
            textStyle:titleTextStyle
        },
        tooltip : {
            showDelay : 0,
            axisPointer:{
                show: true,
                type : 'cross',
                lineStyle: {
                    type : 'dashed',
                    width : 1
                }
            },
            formatter : function (params) {
                    return params.value[2] + ' :<br/>'
                       + params.value[0] + ' ,'
                       + params.value[1] + ' ';
            }
        },
        xAxis : [
            {
            	name: xyAx.xAxis.desc,
                type : 'value',
                scale:true
            }
        ],
        yAxis : [
            {
            	name: xyAx.yAxis.desc,
                type : 'value',
                scale:true
            }
        ],
        toolbox: echartToolbox,
        series : series,
        backgroundColor:backgroundColor
    };
	if(chartParams.isDataZoom){
		var dataZoomOption=[{type:'inside',xAxisIndex: [0],start: 0,end:100 },
		                    {type:'inside',yAxisIndex: [0],start: 0,end:100 }
							];
	 	option.dataZoom=dataZoomOption;
	}

	initSeting(container,option,chartParams);
}
/**
 *
 * @ Discription:散点图-医政首页使用，图内显示一年数据，但是提示框中需要显示比较值
 * @Autor ：WENYI
 * @param container
 * @param xyAx
 * @param data
 * @param title
 * @param subtitle
 * 2017年7月6日下午3:11:02
 */
function scatterChartYZHome(container, xyAx, data, title, subtitle,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var group = {data: [], show: false};
	var series =[];
	if(data!=undefined && data.length>0){
		for (var i = 0; i < data.length; i++) {
		    group.data.push(data[i].ddesc);
		    var d1 = [];
		    d1.push(data[i][xyAx.xAxis.code]);
		    d1.push(data[i][xyAx.yAxis.code]);
		    var data1 = [];
		    data1.push(d1);
		    var serie1 = {};
		    serie1 = { name: data[i].ddesc,data: data1, type: 'scatter',symbolSize:10 }
		    if(data[i].color!=null)
	    	{
		    	serie1.itemStyle= { normal:{color:data[i].color} }
	    	}
		    if(data[i].shape!=null)
	    	{
		    	serie1.symbol= data[i].shape
	    	}
		    if(data[i].size!=null&&data[i].size>10)
	    	{
		    	serie1.symbolSize= data[i].size
	    	}
		    if(typeof(chartParams.markPointData[i])!="undefined"&&chartParams.markPointData[i].index==i)
    		{
	    		serie1.markPoint = jQuery.extend(true,{},chartParams.markPointConfig);
	    		var point = chartParams.markPointData[i];
	    		serie1.markPoint.data.push({xAxis: point.datax,yAxis:point.datay,label:{normal:{textStyle:{color:'#333'}}}});//添加标记点
    		}

		    series.push(serie1);
		}
	}
	var option = {
			title : {
	        text: title,
	        textStyle:titleTextStyle
	        },
	        legend: group,
	        grid:{
	        	containLabel:true,
	        	left:10
	        },
	        tooltip : {
	            showDelay : 0,
	            axisPointer:{
	                show: true,
	                type : 'cross',
	                lineStyle: {
	                    type : 'dashed',
	                    width : 1
	                }
	            },

	            formatter:function(params,ticket,callback){
	            	if(params.componentType=="markPoint")
            		{
	            		return params.seriesName;
            		}
	            	else
	            	{
	            		var tP = "";//本期
		            	var lP = "";//同期
		            	var mrType = paramTabPage[tabId].mrType;//时间类型
		            	if(mrType == "M")
		        		{
		            		tP = getYwcHomePageTime("M","t",params.seriesName);
		            		lP = getYwcHomePageTime("M","l",params.seriesName);
		        		}
		            	else
		        		{
		            		tP = params.seriesName;
		            		lP = getYwcHomePageTime(mrType,"",tP);
		        		}
		            	if(container.selector.indexOf("cap-chart")>=0)
			    		{//这个是CMI DRG组数
			        		var cmicc = paramTabPage[tabId].cmiDrg[params.seriesIndex].CMIcc;
			        		var drgcc = paramTabPage[tabId].cmiDrg[params.seriesIndex].DRGCountcc;
			        		cmicc = typeof(cmicc)=="undefined"?"-":cmicc;
			        		drgcc = typeof(drgcc)=="undefined"?"-":drgcc;
			        		return "本期("+tP+"):"+params.value[0]+","+params.value[1]+"<br/>同期("+lP+"):"+cmicc+","+drgcc;
			    		}
			        	else
			    		{
			        		var timecc = paramTabPage[tabId].timeFee[params.seriesIndex].TimeEffcc;
			        		var feecc = paramTabPage[tabId].timeFee[params.seriesIndex].FeeEffcc;
			        		timecc = typeof(timecc)=="undefined"?"-":timecc;
			        		feecc = typeof(feecc)=="undefined"?"-":feecc;
			        		return  "本期("+tP+"):"+params.value[0]+","+params.value[1]+"<br/>同期("+lP+"):"+timecc+","+feecc;
			    		}
		            }
		        }
	        },
	        xAxis : [
	            {
	            	name: xyAx.xAxis.desc,
	            	nameLocation: 'middle',
	            	nameGap:30,
	                type : 'value',
	                scale:true
	            }
	        ],
	        yAxis : [
	            {
	            	name: xyAx.yAxis.desc,
	                type : 'value',
	                scale:true
	            }
	        ],
	        toolbox: echartToolbox,
	        series : series,
	        backgroundColor:backgroundColor
	    };

		if(!$("#searchcq").children().eq(3).find("div.ci a").eq(0).hasClass("active"))
		{
			delete option.tooltip.formatter;
		}
		var dataZoomOption=[{type:'inside',xAxisIndex: [0],start: 0,end:100 },
		                    {type:'inside',yAxisIndex: [0],start: 0,end:100 }
							];
	 	option.dataZoom=dataZoomOption;
		var myChart=initSeting(container,option,chartParams);
}
/**
 *
 * @ Discription:散点图 专科建设中用
 * @Autor ：WENYI
 * @param container
 * @param series
 * @param xAxis
 * @param yAxis
 * @param toolbox
 * @param title
 * @returns
 * 2017年7月19日下午4:55:05
 */
function scatterSpecial(container,series,xAxis,yAxis,toolbox,title,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var gridLeft=chartParams.gridLeft==undefined?60:chartParams.gridLeft;//坐标与左边的距离
	var gridRight=chartParams.gridRight==undefined?'10%':chartParams.gridRight;//坐标与右边的距离
	var gridTop=chartParams.gridTop==undefined?'60':chartParams.gridTop;//坐标与顶部的距离
	var gridBottom=chartParams.gridBottom==undefined?'60':chartParams.gridBottom;//坐标与底部的距离
    var dataZoom=chartParams.isDataZoom==true?true:false;//是否启动缩放
	var option = {
	        title : {
	            text: title,
	            textStyle:titleTextStyle
	        },
	        grid: {
	 	        left: gridLeft,
	 	        right:gridRight,
	 	        top:gridTop,
	 	        bottom:gridBottom
	 	    },
	        tooltip : {
	            showDelay : 0,
	            axisPointer:{
	                show: true,
	                type : 'cross',
	                lineStyle: {
	                    type : 'dashed',
	                    width : 1
	                }
	            }
	        },
	        xAxis : xAxis,
	        yAxis : yAxis,
	        toolbox: toolbox,
	        series : series,
	        backgroundColor:backgroundColor
	    };
    //数据缩放
    if(dataZoom&&series[0].data.length>10){
    	var dataZoomOption=[{type:'inside',xAxisIndex: [0],start: 0,end:100 },
		                    {type:'inside',yAxisIndex: [0],start: 0,end:100 }
							];
        option.dataZoom=dataZoomOption;
    };
	var myChart=initSeting(container,option,chartParams);
	return myChart;
}

/**
 * 自定义饼图--未入组
 * @param container 图片容器
 * @param data 图片数据
 * @param title 图片主标题
 * @param subtitle 图片副标题
 * @param showbg 是否显示背景色
 * @param cbFun 回调函数
 * @param piece 默认选中的块
 */
function pieChartsNotInGroup(container, data, title, subtitle,chartParams){
	var myChart;
	chartParams=chartParams==undefined?{}:chartParams;
	var groupData = [];
	for(var o in data){
		groupData.push(data[o].name);
	}
    var option = {
    		title : {
		        text: title,
		        subtext: subtitle,
		        left:'left',
		        textStyle:titleTextStyle
		    },
		    tooltip : {
		        trigger: 'item',
		        formatter:
		        	function(params,ticket,callback){
	          			return params.data.fullName+": <br/>"+params.value+"("+params.percent+"%)";
		        	}
		    },
		    toolbox: {
		        show : true,
		        orient: 'horizontal',
		        right: 'right',
		        top: 'top',
		        feature : {
		        	myTool1: {
		                show: true,
		                title: '保存',
		                icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',
		                onclick: function (){
		                    var tempChart=document.createElement( 'div');
		                    tempChart.style.cssText = "width:800px;height:400px;";
		                    var optionTemp=myChart.getOption();

		                	var myChartTemp = echarts.init(tempChart,'infographic');
		                	optionTemp['animation']=false;
		                	optionTemp.series[0].data=chartParams.fullData;
		                	myChartTemp.setOption(optionTemp);
		                	var data=myChartTemp.getDataURL();
		                    var saveLink = document.createElement('a');
		        		    saveLink.href = data;
		        		    saveLink.download =  optionTemp.title[0].text+'.png';
		        		    saveLink.target = '_blank';
		        		    saveLink.click();
		                }
		            }
		        }
		    },
		    series : [
		        {
		            name: "占比",
		            type:'pie',
		            radius : '55%',
		            center: ['50%', '60%'],
		            selectedMode:'single',
		            data:data
		        }
		    ],
	        backgroundColor:backgroundColor
    };
    myChart=initSeting(container,option,chartParams);
    if(data.length==0){
    	myChart.showLoading(noDataShowStyle);
    	myChart.setOption({
    		title:{show:true},toolbox:{show:false},yAxis:{show:false},xAxis:{show:false},legend:{show:false}
    	});
    }
    //悬浮图
	var hoverOption = jQuery.extend(true, {}, option);
	hoverOption.backgroundColor='#eee';
	hoverOption.toolbox.show=false;
	hoverOption.series[0].data=chartParams.fullData;
	initSeting(chartParams.subContainer,hoverOption,chartParams);

	if(typeof(chartParams.clickFunc)!="undefined")
	{
		myChart.on('click', function (params) {
			chartParams.subContainer.css('display','none');
			chartParams.clickFunc(params);
		});
	}
	myChart.on('mouseover', function (params) {
		chartParams.subContainer.css('display','block');
	});
	myChart.on('mouseout', function (params) {
		chartParams.subContainer.css('display','none');
	});
}
/**
 * 环形图
 * @ Discription:
 * @Autor ：WENYI
 * @param container
 * @param legend 图例
 * @param series 数据
 * 2017年7月12日下午11:24:02
 */
function doughnutChart(container,legend,series,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var option = {
		    toolbox: echartToolbox,
		    legend: legend,
		    series : series,
	        backgroundColor:backgroundColor
    };
	var myChart=initSeting(container,option,chartParams);
	return myChart;
}

/**
 * 分析报告用饼图
 * @param container
 * @param data
 * @param title
 * @param subtitle
 * @param chartParams
 * @returns
 */
function reportPieCharts(isEchartToolbox,radius,imgName,container, data, title, subtitle,chartParams){//container:放图的容器，lines：bar（存放信息） title：主标题 subtitle：副标题
	chartParams=chartParams==undefined?{}:chartParams;
	var legendShow=true;
	var titleX = 'center';
	var legendY = 'bottom';
	var toolboxShow = true;
	radius = radius+'%';
	var center = ['50%', '50%'];
	var group = {data: []};
	var showLabel = true;
	var showLabelLine = true;

	var reportEchartToolbox={
			right:'35',
		    show : isEchartToolbox,
		    feature : {
		    	dataView : {show: true, readOnly: true},
		        saveAsImage : {show: true}
		    }
		}               //工具箱是否展示
	group.top=legendY;
	group.show=legendShow;
	for(var o in data){
		group.data.push(data[o].name);
	}
    var option = {
    		title : {
		        text: title,
		        subtext: subtitle,
		        left:titleX,
		        textStyle:titleTextStyle
		    },
		    toolbox: reportEchartToolbox, //工具箱
		    tooltip : {
		        trigger: 'item',
		        formatter: "{a} <br/>{b} : <br/>{c} ({d}%)",
		        position: 'bottom'
		    },
		    legend: group,
		    series : [
		        {
		            name: "占比",
		            type:'pie',
		            radius : radius,
		            center: center,
		            data:data,
		            itemStyle: {
		                emphasis: {
		                    shadowBlur: 10,
		                    shadowOffsetX: 0,
		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
		                },
		                 normal : {
			                label : {
			                  formatter: "{b} \n {d}%"
			                },
			                labelLine : {
			                  length:0
			                }
			              }
		            },
		            animation: false   //将动画 关掉，保证分析报告 图片正常导出
		        }
		    ]
    };
    var myChart=initSeting(container,option,chartParams);
    if(imgName){
    	 sendImaData(imgName,myChart);
    }
    if(data.length==0){
    	myChart.showLoading(noDataShowStyle);
    }
}
/**
 * 分析报告用散点图
 * @param container
 * @param xyAx
 * @param data
 * @param title
 * @param subtitle
 * @returns
 */
function newReportScatterChart(isEchartToolbox ,imgName,container, xyAx, data, title, subtitle,xMarkLineValue,yMarkLineValue,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var d1 = [];
	var d2 = [];
	var d3 = [];
	var d4 = [];
	var reportEchartToolbox={
			right:'35',
		    show : isEchartToolbox,
		    feature : {
		    	dataView : {show: true, readOnly: true},
		        saveAsImage : {show: true}
		    }
		}               //工具箱是否展示
	if(data!=undefined && data.length>0){
		var series=[];
		for (var i = 0; i < data.length; i++) {
		    var d1 = [];
		    d1.push(data[i][xyAx.xAxis.code]);
		    d1.push(data[i][xyAx.yAxis.code]);
		    var data1 = [];
		    data1.push(d1);
		    var serie1 = {};
		    serie1 = { name: data[i].name,data: data1, type: 'scatter',symbolSize:10 }
		    if(data[i].color!=null)
	    	{
		    	serie1.itemStyle= { normal:{color:data[i].color} }
	    	}
		    if(data[i].shape!=null)
	    	{
		    	serie1.symbol= data[i].shape
	    	}
		    if(data[i].size!=null&&data[i].size>10)
	    	{
		    	serie1.symbolSize= data[i].size
	    	}

		    series.push(serie1);
		}
	}
    var markLine ={};
    markLine ={
        lineStyle: {
            normal: {
                type: 'solid'
            }
        },
        data : [
            { xAxis: yMarkLineValue },{yAxis: xMarkLineValue}
        ]
    }
    series[0].markLine =markLine;

	var option = {
        title : {
            text: title,
            textStyle:titleTextStyle
        },
        toolbox: reportEchartToolbox, //工具箱
        grid:{
        	 left: '3%',
             right: '20%',
             bottom: '3%',
             containLabel: true
        },           //坐标字体位置
        tooltip : {
            trigger: 'axis',
            showDelay : 0,
            axisPointer:{
                show: true,
                type : 'cross',
                lineStyle: {
                    type : 'dashed',
                    width : 1
                }
            }
        },
        xAxis : [
            {
            	name: xyAx.xAxis.desc,
                type : 'value',
                scale:true
            }
        ],
        yAxis : [
            {
            	name: xyAx.yAxis.desc,
                type : 'value',
                scale:true
            }
        ],
        series : series
    };
	var myChart=initSeting(container,option,chartParams);
	if(imgName){
	    	 sendImaData(imgName,myChart);
	    }
}
/**
 * 分析报告将图填充到文档中
 * @param imgName
 * @param myChart
 * @returns
 */
function sendImaData(imgName,myChart){
	var imgData = myChart.getDataURL("png");
	$.ajax({
        type : "post",
        async : true,
        url: contextPath + "/WordDRGsReport/saveImg.dhc",
        data : {
             	'imgData':imgData,
             	'imgName':imgName
             	},
        async : false,
        success : function(data){
      	  console_wt(imgName+'图表生成成功！')
        }
  });
}
/**
 *
 * @ Discription:图例分页 legend 的分页控制 事件
 * @Autor ：WENYI
 * @param myChart
 * @param container
 * @param pagemode
 * @param pagemodeLegendNewlineFlag
 * @param pagemodeLegendWidth
 * @param i 移动的距离
 * 2017年7月28日下午5:59:55
 */
function legendPagemodeCommon(myChart,container,pagemode,pagemodeLegendNewlineFlag,pagemodeLegendWidth){
	var maxClickCount=0;//最大点击次数
	//判断图例是否换行，如果换行则移动legend位置
    if(pagemode&&pagemodeLegendNewlineFlag){
		container.nextAll('.js-eclegend-tool').remove();//添加元素之前，可能js-eclegend-tool已经存在，先移除
		container.after(legendPagemodeContainer);
    	container.next('.js-eclegend-tool').html(legendPagemodeHtml);
    	myChart.setOption({
            legend: {
                left: 0
            }
        });
    	container.nextAll('.legendNewLine').remove();
    	maxClickCount=Math.ceil(pagemodeLegendWidth/$(container).width())-1;//最大点击次数
    	var clickCount =0;//点击次数
    	container.next('.js-eclegend-tool').off('click', '.js-prePage');
    	container.next('.js-eclegend-tool').on('click','.js-prePage',function () {
            if (clickCount > 0) {
                clickCount = clickCount - 1;
                legendPageEvent(myChart,clickCount);
                container.nextAll('.legendNewLine').remove();
                container.next().find('.js-nextPage i').attr({'title': '下一页'});
                container.next().find('.js-nextPage i').css({'color':'#1296DB'});
                if(clickCount==0){
                	container.next().find('.js-prePage i').attr({'title': '已经是第一页'});
                	container.next().find('.js-prePage i').css({'color':'#BFBFBF'});
                }
            }
        });

    	container.next('.js-eclegend-tool').off('click', '.js-nextPage');
    	container.next('.js-eclegend-tool').on('click','.js-nextPage',function () {
        	if(clickCount<maxClickCount){
        		clickCount = clickCount + 1;
        		legendPageEvent(myChart,clickCount);
        		container.nextAll('.legendNewLine').remove();
                container.next().find('.js-prePage i').attr({'title': '上一页'});
                container.next().find('.js-prePage i').css({'color':'#1296DB'});
                if(clickCount>=maxClickCount){
                	container.next().find('.js-nextPage i').attr({'title': '已经是最后一页'});
                	container.next().find('.js-nextPage i').css({'color':'#BFBFBF'});
                }
        	}
        });
    }
    else{
    	container.nextAll('.js-eclegend-tool').remove();
    }
}
/**
 *
 * @ Discription:图例分页 改变图例位置时间
 * @Autor ：WENYI
 * @param myChart
 * @param i 移动的距离
 * 2017年7月28日下午5:59:55
 */
function legendPageEvent(myChart,i) {
    var percent = -i * 98 + '%';
    myChart.setOption({
        legend: {
            left: percent
        }
    });
};
/**
 *
 * @ Discription:Echarts初始化设置
 * @Autor ：WENYI
 * @param container
 * @param option
 * 2017年7月4日上午11:04:24
 */
function initSeting(container,option,chartParams){
	if(chartParams.autoWidth&&chartParams.autoHeight=='auto'){//随窗口变化
		var heightRatio=chartParams.heightRatio==undefined?1:chartParams.heightRatio;
		chartParams.domHeight=container.width()*heightRatio;
		container.css( 'height', chartParams.domHeight);
	}
	else if(chartParams.autoWidth&&chartParams.autoHeight=='init'){//初始化时，获取高度，之后不随窗口变化
		var heightRatio=chartParams.heightRatio==undefined?1:chartParams.heightRatio;
		chartParams.domHeight=container.width()*heightRatio;
		container.css( 'height', chartParams.domHeight);
	}
	else if(chartParams.autoWidth){
		chartParams.domHeight=container.height();
	}
	var contain = container[0];
	var myChart = echarts.init(contain,'infographic');
    myChart.setOption(option);
    if(chartParams&&chartParams.autoWidth){
    	window.addEventListener("resize", function () {
    		addDataTableHeadClass();
    		var width=container.width();
    		var height=chartParams.domHeight;
        	if(chartParams.autoHeight=='auto'){
        		var temp=width*chartParams.heightRatio;
        		height=temp==0?height:temp;
        	}
        	container.css( 'width', container.width());
        	container.css( 'height', height);
   		 	myChart.resize();
   		 	container.css( 'width', '100%');
   		 	removeDataTableHeadClass();
       });
    }
    return myChart;
}
function echartLoadingInit(container){
	addDataTableHeadClass();
	var contain = container[0];
	container.css( 'width', container.width());
	container.css( 'height', 250);
	var myChart = echarts.init(contain,'infographic');
	myChart.showLoading(loadingDataShowStyle);
	container.css('width', '100%');
	removeDataTableHeadClass();
}


/**
 * 条形图
 * @@param echartId divId
 * @@param param option 参数
 * @@param callback 回调函数
 * @@param echarType echart类型
 * @void
 * @ Discription:
 * @paygroupCommon.js
 */
function drawPayGroupBarChart(echartId,param,callback,echarType) {
	var labelRight = {
			normal: {
				position: 'right'
			}
	};
	// series 设置
	var type = "bar" ;
	var stack = "总量" ;
    var label = {
        normal: {
            show: true,
            color:"#ddd",
            position: 'right'
        }
    };
	var option = {
			title: {
				text: '',
				padding: 5,
				textStyle : {
					fontStyle:'normal' ,
					fontWeight:'normal' ,
					fontFamily:'微软雅黑' ,
					fontSize:'14'
				},
				top: 0
			},
			legend: {
		    },
		    toolbox: {
		        feature: {
		        	saveAsImage: {}
		        }
		    },
			tooltip : {
				trigger: 'axis',
				axisPointer : {            // 坐标轴指示器，坐标轴触发有效
					type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				}
			},
			grid: {
				show:true ,
				top: 50,
				bottom: 20,
				borderWidth:0 ,
				containLabel :true
			},
			xAxis : [
			         {
			             type : 'value' ,
			             boundaryGap: [0, 0.01]
			         }
			     ],
		     yAxis : [
		         {
		             type : 'category',
//		             axisTick : {show: false},
		             splitLine:{show:true,interval:0},
		             data : []
		         }
		     ],
		     series : [ ]
	};
	if(param) {
		option.title.text = param.title ;
		if(param.legend) {
			option.legend = param.legend ;
		}
		if(param.y && param.y.data) {
			option.yAxis[0].data = param.y.data ;
		}
		if(param.dataZoom)
		{
			option.dataZoom = param.dataZoom;
		}
		for( var o = 0 ; o < param.series.length ; o++ ) {
			if(!param.series[o].type) {
				param.series[o].type = type ;
			}
			if(!param.series[o].label) {
				var labelCopy = jQuery.extend(true, {}, label) ;
				// 数字显示交替变换位置
				if (o == 2) {
					labelCopy.normal.position = "left" ;
				} else {
					labelCopy.normal.position = "right" ;
				}
				param.series[o].label = labelCopy ;
			}
			if(echarType && echarType == "stackbar") {
				param.series[o].stack = stack ;
				// 堆叠柱状图 图上不显示数字
				label.normal.show = false ;
				param.series[o].label  = label ;
			} else if(param.series.length > 1 && o > 0 ) {
				// 交错正负轴图,series 中元素大于 1 ,如果设置了stack
				if(!param.series[o].stack) {
					param.series[o].stack = stack ;
				}
			} else if(param.series.length == 1) {
				param.series[o].stack = stack ;
			}
			option.series.push(param.series[o]) ;
		}
	}
	var myChart = echarts.init(document.getElementById(echartId),'infographic');
	myChart.setOption(option);
	if(callback) {
		myChart.on('click', callback);
	}
}
/**
 * poi技术新版分析报告用饼图
 * @param container
 * @param data
 * @param title
 * @param subtitle
 * @param chartParams
 * @returns
 */
function analysisReportPieCharts(isEchartToolbox,radius,imgName,container, data, title, subtitle,chartParams){//container:放图的容器，lines：bar（存放信息） title：主标题 subtitle：副标题
	chartParams=chartParams==undefined?{}:chartParams;
	var legendShow=true;
	var titleX = 'center';
	var legendY = 'bottom';
	var toolboxShow = true;
	radius = radius+'%';
	var center = ['50%', '50%'];
	var group = {data: []};
	var showLabel = true;
	var showLabelLine = true;

	var reportEchartToolbox={
			right:'35',
		    show : isEchartToolbox,
		    feature : {
		    	dataView : {show: true, readOnly: true},
		        saveAsImage : {show: true}
		    }
		}               //工具箱是否展示
	group.top=legendY;
	group.show=legendShow;
	for(var o in data){
		group.data.push(data[o].name);
	}
    var option = {
    		title : {
		        text: title,
		        subtext: subtitle,
		        left:titleX,
		        textStyle:titleTextStyle
		    },
		    tooltip : {
		        trigger: 'item',
		        formatter: "{a} <br/>{b} : <br/>{c} ({d}%)",
		        position: 'bottom'
		    },
		    legend: group,
		    series : [
		        {
		            name: "占比",
		            type:'pie',
		            radius : radius,
		            center: center,
		            data:data,
		            itemStyle: {
		                emphasis: {
		                    shadowBlur: 10,
		                    shadowOffsetX: 0,
		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
		                },
		                 normal : {
			                label : {
			                  formatter: "{b} \n {d}%"
			                },
			                labelLine : {
			                  length:0
			                }
			              }
		            },
		            animation: false   //将动画 关掉，保证分析报告 图片正常导出
		        }
		    ]
    };
    var myChart=initSeting(container,option,chartParams);
    if(imgName){
    	 sendAnalyData(imgName,myChart);
    }
    if(data.length==0){
    	myChart.showLoading(noDataShowStyle);
    }
}

/**
 * 分析报告用散点图
 * @param container
 * @param xyAx
 * @param data
 * @param title
 * @param subtitle
 * @returns
 */
function analysisReportScatterChart(isEchartToolbox ,imgName,container, xyAx, data, title, subtitle,xMarkLineValue,yMarkLineValue,chartParams){
	chartParams=chartParams==undefined?{}:chartParams;
	var d1 = [];
	var d2 = [];
	var d3 = [];
	var d4 = [];
	var reportEchartToolbox={
			right:'35',
		    show : isEchartToolbox,
		    feature : {
		    	dataView : {show: true, readOnly: true},
		        saveAsImage : {show: true}
		    }
		}               //工具箱是否展示
	if(data!=undefined && data.length>0){
		var series=[];
		for (var i = 0; i < data.length; i++) {
		    var d1 = [];
		    d1.push(data[i][xyAx.xAxis.code]);
		    d1.push(data[i][xyAx.yAxis.code]);
		    var data1 = [];
		    data1.push(d1);
		    var serie1 = {};
		    serie1 = { name: data[i].name,data: data1, type: 'scatter',symbolSize:10 }
		    if(data[i].color!=null)
	    	{
		    	serie1.itemStyle= { normal:{color:data[i].color} }
	    	}
		    if(data[i].shape!=null)
	    	{
		    	serie1.symbol= data[i].shape
	    	}
		    if(data[i].size!=null&&data[i].size>10)
	    	{
		    	serie1.symbolSize= data[i].size
	    	}

		    series.push(serie1);
		}
	}
    var markLine ={};
    markLine ={
        lineStyle: {
            normal: {
                type: 'solid'
            }
        },
        data : [
            { xAxis: yMarkLineValue },{yAxis: xMarkLineValue}
        ]
    }
    series[0].markLine =markLine;

	var option = {
        title : {
            text: title,
            textStyle:titleTextStyle
        },
        grid:{
        	 left: '3%',
             right: '20%',
             bottom: '3%',
             containLabel: true
        },           //坐标字体位置
        tooltip : {
            trigger: 'axis',
            showDelay : 0,
            axisPointer:{
                show: true,
                type : 'cross',
                lineStyle: {
                    type : 'dashed',
                    width : 1
                }
            }
        },
        xAxis : [
            {
            	name: xyAx.xAxis.desc,
                type : 'value',
                scale:true
            }
        ],
        yAxis : [
            {
            	name: xyAx.yAxis.desc,
                type : 'value',
                scale:true
            }
        ],
        series : series
    };
	var myChart=initSeting(container,option,chartParams);
	if(imgName){
		  sendAnalyData(imgName,myChart);
	    }
}
/**
 * poi技术新版分析报告将图填充到文档中
 * @param imgName
 * @param myChart
 * @returns
 */
function sendAnalyData(imgName,myChart){
	var imgData = myChart.getDataURL("png");
	$.ajax({
        type : "post",
        async : true,
        url: contextPath + "/analysisDRGsReport/saveARImgTest.dhc",
        data : {
             	'imgData':imgData,
             	'imgName':imgName
             	},
        async : false,
        success : function(data){
      	//  console_wt(imgName+'图表生成成功！')
        }
  });
}
